home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / IP12nvram.h.z / IP12nvram.h
C/C++ Source or Header  |  1992-04-03  |  5KB  |  170 lines

  1. #ident "include/sys/IP12nvram.h: $Revision: 1.6 $"
  2.  
  3. /* 
  4.  * IP12nvram.h - the NVRAM offsets, etc. 
  5.  */
  6.  
  7. /*
  8.  * non-volatile ram addresses
  9.  * note: everything must fit with 128 bytes.  the national nmc93cs46
  10.  * is arranged as 64 sixteen bit registers.
  11.  */
  12. #define NVLEN_MAX        128
  13.  
  14. /*
  15.  * bootmode controls autoboot/command mode on reset
  16.  */
  17. #define NVOFF_BOOTMODE        0
  18. #define NVLEN_BOOTMODE        1
  19. #define NVRAM_BOOTMODE        (NVOFF_BOOTMODE << 2)
  20.  
  21. /*
  22.  * state maintains the current validity of the tod clock and
  23.  * non-volatile ram
  24.  */
  25. #define NVOFF_STATE        1
  26. #define NVLEN_STATE        1
  27. #define NVRAM_STATE        (NVOFF_STATE << 2)
  28.  
  29. /*
  30.  * netaddr is used by network software to determine the internet
  31.  * address, it should be a string containing the appropriate
  32.  * network address in "." format. XXX: could easily be in 4 binary bytes
  33.  */
  34. #define NVOFF_NETADDR        (NVOFF_STATE + NVLEN_STATE)
  35. #define NVLEN_NETADDR        16
  36.  
  37. /*
  38.  * lbaud/rbaud are the initial baud rates for the duart
  39.  */
  40. #define NVOFF_LBAUD        (NVOFF_NETADDR + NVLEN_NETADDR)
  41. #define NVLEN_LBAUD        5
  42.  
  43. #define NVOFF_RBAUD        (NVOFF_LBAUD + NVLEN_LBAUD)
  44. #define NVLEN_RBAUD        5
  45.  
  46. /*
  47.  * console controls what consoles are enabled at power-up
  48.  */
  49. #define NVOFF_CONSOLE        (NVOFF_RBAUD + NVLEN_RBAUD)
  50. #define NVLEN_CONSOLE        1
  51.  
  52. /*
  53.  * Startup colors
  54.  */
  55. /* screen */
  56. #define NVOFF_SCCOLOR        (NVOFF_CONSOLE + NVLEN_CONSOLE)
  57. #define NVLEN_SCCOLOR        6
  58.  
  59. /* page */
  60. #define NVOFF_PGCOLOR        (NVOFF_SCCOLOR + NVLEN_SCCOLOR)
  61. #define NVLEN_PGCOLOR        6
  62.  
  63. /* logo */
  64. #define NVOFF_LGCOLOR        (NVOFF_PGCOLOR + NVLEN_PGCOLOR)
  65. #define NVLEN_LGCOLOR        6
  66.  
  67. /*
  68.  * for compatability with old nvram
  69.  */
  70. #define NVOFF_PAD0        (NVOFF_LGCOLOR + NVLEN_LGCOLOR)
  71. #define NVLEN_PAD0        2
  72.  
  73. /*
  74.  * register used to hold the checksum.
  75.  */
  76. #define NVOFF_CHECKSUM        (NVOFF_PAD0 + NVLEN_PAD0)
  77. #define    NVLEN_CHECKSUM        1
  78.  
  79. /*
  80.  * indicate whether we are running as a diskless station or not
  81.  */
  82. #define NVOFF_DISKLESS        (NVOFF_CHECKSUM + NVLEN_CHECKSUM)
  83. #define    NVLEN_DISKLESS        1
  84.  
  85. /*
  86.  * nokbd indicates if the system is allowed to boot without a keyboard
  87.  */
  88. #define NVOFF_NOKBD        (NVOFF_DISKLESS + NVLEN_DISKLESS)
  89. #define NVLEN_NOKBD        1
  90.  
  91. /*
  92.  * bootfile is the initial program loaded on an autoboot
  93.  */
  94. #define NVOFF_BOOTFILE        (NVOFF_NOKBD + NVLEN_NOKBD)
  95. #define NVLEN_BOOTFILE        50
  96.  
  97. #define PASSWD_LEN        8
  98. /*
  99.  * password_key is an encrypted key for protecting manual mode
  100.  */
  101. #define    NVOFF_PASSWD_KEY    (NVOFF_BOOTFILE+NVLEN_BOOTFILE)
  102. #define    NVLEN_PASSWD_KEY      (2*PASSWD_LEN+1)
  103.  
  104. /*
  105.  * volume is the default audio volume for the system and is also the
  106.  * volume at which the boot tune is played.  If volume is set to zero,
  107.  * then the boot tune is not played.  If set to 255, then the boot tune
  108.  * is played at full volume.
  109. */
  110. #define NVOFF_VOLUME        (NVOFF_PASSWD_KEY+NVLEN_PASSWD_KEY)
  111. #define NVLEN_VOLUME        3
  112.  
  113. /* add more read/write variables here ^ */
  114.  
  115. #define NVOFF_CMD    (NVOFF_VOLUME+NVLEN_VOLUME)
  116. #define NVLEN_CMD    (NVFUSE_START-NVOFF_CMD)
  117. #define NVOFF_LAST    (NVOFF_CMD+NVLEN_CMD)
  118.  
  119. /* total length of used read/write nv ram */
  120. #define NVRW_TOTAL        (NVOFF_LAST)
  121.  
  122. /*
  123.  * EVERYTHING PAST THIS POINT WILL BE WRITE PROTECTED
  124.  *
  125.  * The write protected nvram is allocated in reverse order starting
  126.  * at the end of nvram.
  127.  */
  128.  
  129. /*
  130.  * ethernet physical address
  131.  */
  132. #define    NVLEN_ENET        6
  133. #define NVOFF_ENET        (NVLEN_MAX-NVLEN_ENET)
  134.  
  135. /* add more write protected variables here ^ */
  136.  
  137. /* low address of write protected nvram */
  138. #define NVFUSE_START        NVOFF_ENET
  139.  
  140. #if NVRW_TOTAL > NVFUSE_START
  141. # include "error -- non-volatile ram overflow"
  142. #endif
  143.  
  144. /* Control opcode for nonvolatile ram on IP12  */
  145. #define SER_READ    0xc000        /* serial memory read */
  146. #define SER_WEN        0x9800        /* write enable before prog modes */
  147. #define SER_WRITE    0xa000        /* serial memory write */
  148. #define SER_WRALL    0x8800        /* write all registers */
  149. #define SER_WDS        0x8000        /* disable all programming */
  150. #define    SER_PRREAD    0xc000        /* read protect register */
  151. #define    SER_PREN    0x9800        /* enable protect register mode */
  152. #define    SER_PRCLEAR    0xffff        /* clear protect register */
  153. #define    SER_PRWRITE    0xa000        /* write protect register */
  154. #define    SER_PRDS    0x8000        /* disable protect register, forever */
  155.  
  156. /* maximum length of an nvram entry name (e.g. "netaddr", "bootfile") */
  157. #define MAXNVNAMELEN    16
  158.  
  159. #ifdef LANGUAGE_C
  160. /* format used to store nvram table information
  161.  */
  162. struct nvram_entry {
  163.     char nt_name[MAXNVNAMELEN];        /* string name of entry */
  164.     char *nt_value;            /* PROM: string for default value */
  165.                     /* UNIX: current value of entry */
  166.     int nt_nvaddr;            /* offset to entry in nvram */
  167.     int nt_nvlen;            /* length of entry in nvram */
  168. };
  169. #endif /* LANGUAGE_C */
  170.